<%@ page import="java.util.Date" %>
<%@ page import="sun.util.resources.LocaleData" %>
<%@ page import="java.time.LocalDateTime" %>
<%@ page import="java.time.LocalDate" %>
<%@ page import="java.time.ZoneId" %><%--
  Created by IntelliJ IDEA.
  User: 杨威
  Date: 2021/9/16
  Time: 17:38
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>emplist</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link rel="stylesheet" type="text/css" href="css/style.css" />
</head>
<body>
<div id="wrap">
    <div id="top_content">
        <div id="header">
            <div id="rightheader">
                <p>
                   <%=new Date().toInstant()%>
                    <br />
                </p>
            </div>
            <div id="topheader">
                <h1 id="title">
                    <a href="#">员工列表</a>
                </h1>
            </div>
            <div id="navigation">
            </div>
        </div>
        <div id="content">
            <p id="whereami">
            </p>
            <h1>
                Welcome!${user.userName}
            </h1>
            <table class="table">
                <tr class="table_header">
                    <td>
                        ID
                    </td>
                    <td>
                        Name
                    </td>
                    <td>
                        Salary
                    </td>
                    <td>
                        Age
                    </td>
                    <td>
                        Operation
                    </td>
                </tr>
                <c:forEach items="${emps}" var="emp">
                    <tr class="row1">
                        <td>
                                ${emp.id}
                        </td>
                        <td>
                            ${emp.name}
                        </td>
                        <td>
                            ${emp.salary}
                        </td>
                        <td>
                            ${emp.age}
                        </td>
                        <td>
                            <a href="delete?id=${emp.id}">删除员工</a>&nbsp;<a href="selectEmp?id=${emp.id}">修改信息</a>
                        </td>
                    </tr>
                </c:forEach>
                <tr>
                    <td>
                        <a href="ShowAll?pageIndex=1">首页</a>
                        <c:if test="${page.pageIndex>1}">
                            <a href="ShowAll?pageIndex=${page.pageIndex-1}">上一页</a>
                        </c:if>
                        <c:if test="${page.pageIndex<page.totalPage}">
                            <a href="ShowAll?pageIndex=${page.pageIndex+1}">下一页</a>
                        </c:if>
                        <a href="ShowAll?pageIndex=${page.totalPage}">尾页</a>
                    </td>
                </tr>

            </table>
            <p>
                <input type="button" class="button" value="添加员工" onclick="location='addEmp.jsp'"/>
            </p>
        </div>
    </div>
    <div id="footer">
        <div id="footer_bg">
            ABC@126.com
        </div>
    </div>
</div>
</body>
</html>
